package com.zerous.staria.ui;

import com.zerous.framework.ui.*;
import com.zerous.framework.*;
import com.zerous.staria.*;

public class Label extends UIBase
{
	Screen screen;
	Game game;
	String title = "";
	Button backBtn;
	public Label(Screen scr, Game g)
	{
		super(new Point(0, 0));
		screen = scr;
		game = g;
		backBtn = new Button(Images.BACK, Images.BACK_D, p.getX() + 20, p.getY() + 20);
		backBtn.setOnClick(new UIBase.OnClick() { public void click() { game.setScreen(screen.parent); }});
	}
	
	public void setTitle(String str)
	{
		title = str;
	}

	@Override
	public void update()
	{
		// TODO: Implement this method
		super.update();
		backBtn.update();
	}

	@Override
	public void draw()
	{
		// TODO: Implement this method
		super.draw();
		Graphics g = Zex.graphics;
		g.drawPixmap(Images.LABEL, p.getX(), p.getY(), 255);
		g.drawText(title, Zex.Const.width/2, Images.LABEL.getHeight()/2, true);
		backBtn.draw();
	}
}
